#modules
import random
import time
import threading
from tkinter import Tk, Label, PhotoImage, messagebox
import os
import sys

#health
ch = 30
mh = 30

#name and inventory setup 3mptv means empty
print("hi welcome to this text based adventure game. before you begin we have a few questions for you.")
name = input("to help make this expierience more personal to you please enter your name: ")
item = input("hi " + name + " to help you on your quest you can choose from a variety of items: ")
slot1 = item

if slot1 == "gun":
    tempyn = input("would you like ammo for your gun (y/n): ")
    if tempyn == "y":
        slot2 = "ammo"
        ammo = 30
        tempyn = input("You have space for one more item would you like to add one, you can always change it later (please answer as y/n): ")
        if tempyn == "y":
            item = input("cool what item would you like to add? ")
            slot3 = item
        else:
            print("okay moving on")
            slot3 = "3mptv"
    else:
        tempyn = input("You have space for another item would you like to add one, you can always change it later (please answer as y/n): ")
        if tempyn == "y":
            item = input("cool what item weould you like to add? ")
            slot2 = item
            tempyn = input("You have space for one more item would you like to add one, you can always change it later (please answer as y/n): ")
            if tempyn == "y":
                item = input("cool what item would you like to add? ")
                slot3 = item
            else:
                print("okay moving on")
                slot3 = "3mptv"
        else:
            print("okay moving on")
            slot2 = "3mptv"
else:
    tempyn = input("You have space for another item would you like to add one, you can always change it later (please answer as y/n): ")
    if tempyn == "y":
        item = input("cool what item weould you like to add? ")
        slot2 = item
        tempyn = input("You have space for one more item would you like to add one, you can always change it later (please answer as y/n): ")
        if tempyn == "y":
            item = input("cool what item would you like to add? ")
            slot3 = item
        else:
            print("okay moving on")
            slot2 = "3mptv"
    else:
        print("okay moving on")
        slot2 = "3mptv"

#map to help chose location
window = Tk()
window.title("Map")
image_path = "map.png"
photo = PhotoImage(file=image_path)
label = Label(window, image=photo)
label.pack()

#make sure nobody closes the map
def on_close():
    confirm = messagebox.askyesno("Exit Map", "are you sure you want to do that.")
    if confirm:
        window.destroy()

window.protocol("WM_DELETE_WINDOW", on_close)

#game is kept in function to allow map to be open at the same time
def continue_game():
    #choose a location
    pl = input("cool your almost ready anow its time to chose a location different locations will have different challenges and rewards and you may not have another chance to choose so choose wisly. you can use the map to help you: ").lower()
    def swim_out_to_sea():
        print("You swim out into the open sea...")
        time.sleep(1)
        print("There's nothing here but waves and silence.")
        choice = input("Would you like to keep swimming or go back? ").lower()
        if "keep" in choice:
            print("You push forward, muscles aching...")
            time.sleep(1)
            print("Eventually, you're washed ashore at a seaside village.")
            time.sleep(0.5)
            print("wou walk into the village")
            time.sleep(0.5)
            print("you look around you to your left is the town hall and to your right there seems to be fome kind of fight")
            choice = input("would you like to \n A) go to the town hall or \n B) ask about the fight\n").lower()
            if "fight" in choice:
                fight()
            elif "hall" in choice:
                town_hall()
        else:
            print("You swim back to the beach, cold and tired.")
            time.sleep(1)
            choice = input("Would you like to:\n A) explore the dunes\n B) look around the shipwreck\n C) swim around the shore again\n").lower()
            if "dunes" in choice:
                explore_dunes()
            elif "ship" in choice:
                explore_shipwreck()
            elif "swim" in choice:
                swim_out_to_sea()
            

    def explore_dunes():
        dunes = 1
        global slot1, slot2, slot3, ch
        choice = input("You see something under the sand. Investigate or ignore? ").lower()
        if choice == "investigate":
            choice = input("It's a treasure chest but it's locked. Take it or stamp on it? ").lower()
            if choice == "take it":
                if slot2 == "3mptv":
                    slot2 = "c3zT"
                    print("You pick up the chest and put it in your bag.")
                elif slot3 == "3mptv":
                    slot3 = "c3zT"
                    print("You pick up the chest and put it in your bag.")
                else:
                    choice = input(f"Your inventory is full: {slot1}, {slot2}, {slot3}. What would you like to chuck out? ").lower()
                    if choice == slot1:
                        slot1 = "c3zT"
                    elif choice == slot2:
                        slot2 = "c3zT"
                    elif choice == slot3:
                        slot3 = "c3zT"
                    else:
                        choice2 = input(f"You don't have a {choice}. Try again: {slot1}, {slot2}, {slot3}. What would you like to chuck out? ").lower()
                        if choice2 == slot1:
                            slot1 = "c3zT"
                        elif choice2 == slot2:
                            slot2 = "c3zT"
                        else:
                            slot3 = "c3zT"
            else:
                print("You stamp on the chest...")
                time.sleep(0.5)
                ch -= 2
                print("A sharp object pierces your leg. Thankfully your shoes took most of the impact.")
                print("It seems to be a sword bound with powerful sea magic. A faint water jet pulses from its hilt.")
                choice = input("Would you like to equip the sea sword? (y/n) ").lower()
                if choice == "y":
                    if slot2 == "3mptv":
                        slot2 = "2w08|)"
                        print("You pick up the sea sword and put it in your bag.")
                    elif slot3 == "3mptv":
                        slot3 = "2w08|)"
                        print("You pick up the sea sword and put it in your bag.")
                    else:
                        choice = input(f"Your inventory is full: {slot1}, {slot2}, {slot3}. What would you like to chuck out? ").lower()
                        if choice == slot1:
                            slot1 = "2w08|)"
                        elif choice == slot2:
                            slot2 = "2w08|)"
                        elif choice == slot3:
                            slot3 = "2w08|)"
                        else:
                            choice2 = input(f"You don't have a {choice}. Try again: {slot1}, {slot2}, {slot3}. What would you like to chuck out? ").lower()
                            if choice2 == slot1:
                                slot1 = "2w08|)"
                            elif choice2 == slot2:
                                slot2 = "2w08|)"
                            else:
                                slot3 = "2w08|)"

    def explore_shipwreck():
        ship = 1
        global slot1, slot2, slot3, ch, ammo
        print("You climb into the wreckage. It's eerie and quiet.")
        time.sleep(1)
        print("Inside a rusted crate, you find some ammo and a glowing sea sword.")

        if slot2 == "3mptv":
            slot2 = "ammo"
            ammo += 20
        elif slot3 == "3mptv":
            slot3 = "ammo"
            ammo += 20
        elif slot2 == "ammo":
            slot2 = "ammo"
            ammo += 20
        elif slot3 == "ammo":
            slot3 = "ammo"
            ammo += 20
        else:
            print("You have no space for ammo. You leave it behind.")

        if slot1 == "3mptv":
            slot1 = "2w08|)"
        elif slot2 == "3mptv":
            slot2 = "2w08|)"
        elif slot3 == "3mptv":
            slot1 = "sword"
            print("the sword binds with yours upgrading it")
            print("achievement earnt: getting an upgrade")
        elif slot2 == "sword":
            slot2 = "2w08|)"
            print("the sword binds with yours upgrading it")
            print("achievement earnt: getting an upgrade")

        elif slot3 == "sword":
            slot3 = "2w08|)"
            print("the sword binds with yours upgrading it")
            print("achievement earnt: getting an upgrade")

        else:
            print("You have no space for the sword. You leave it behind.")

        print("Suddenly, a zombie lurches from the shadows!")
        time.sleep(1)
        zombie_health = 22
        print("It has armor. Max health: 22")

        while zombie_health > 0:
            print(f"Zombie health: {zombie_health}")
            if slot1 =="2w08|)":
                choice = input(f"Choose your weapon: enchanted sword, {slot2}, {slot3} or run: ").lower()
            elif slot2 =="2w08|)":
                choice = input(f"Choose your weapon: {slot1}, enchanted sword, {slot3} or run: ").lower()
            elif slot2 =="2w08|)":
                choice = input(f"Choose your weapon: {slot1}, {slot2}, enchanted sword or run: ").lower()
            else:
                choice = input(f"Choose your weapon: {slot1}, {slot2}, {slot3} or run: ").lower()

            if choice == "run":
                print("You sprint back to the beach, heart pounding.")
                return

            if choice == "gun" and slot1 == "gun" and ("ammo" in [slot2, slot3]) and ammo > 0:
                print("You fire your gun!")
                zombie_health -= 10
                ammo -= 1
                print("The zombie retaliates during reload!")
                print("current ammo {ammo}")
                ch -= 3
                print(f"You take damage. Current health: {ch}")
                if ammo == 0:
                    if slot2 == "ammo":
                        slot2 = "3mptv"
                    elif slot3 == "ammo":
                        slot3 = "3mptv"

            elif choice == "sword" and "2w08|)" in [slot1, slot2, slot3]:
                print("You swing the sea sword! A jet of water blasts the zombie.")
                zombie_health = zombie_health-5

            elif choice == "sword" and "sword" in [slot1, slot2, slot3]:
                print("You swing your sword!")
                zombie_health=zombie_health=2

            else:
                print("You fumble with your gear. The zombie strikes!")
                ch -= 4
                print(f"You take damage. Current health: {ch}")

            time.sleep(1)

        print("You defeated the zombie!")
        print("It drops a glowing token...")
        

        if ch < mh:
            ch = min(ch + 2, mh)
            print(f"The token heals you. Current health: {ch}")
        else:
            print("You're already at full health.")
        if dunes == 1:
            print("having explored the whole beach you swim out to sea")
            time.sleep(0.3)
            print("There's nothing here but waves and silence.")
            time.sleep(0.3)
            print("You push forward, muscles aching...")
            time.sleep(0.3)
            print("Eventually, you're washed ashore on a mysterious jungle island.")
            jungle()

    def town_hall():
        print("you approach the town hall")
        time.sleep(0.3)
        ("you knock on the door and a man opens it who are you he says")
        yn = input("give him your name y/n").lower
        if yn == y:
            print(f"greetings {name} this town was attacked jut an hour ago save it and there would be a reward choose not to and fear my wreath")
            yn = input("save the town y/n").lower
            if choice == y:
                print("you choese well")
                fight
            else:
                print("that was a bad idea")
                time.sleep(0.2)
                print("the man pulls out a gun and puts it to your forhead...")
                time.sleep(0.3)
                print("you hear a bang...")
                time.sleep(0.1)
                print("and everything turns black")
                time.sleep(1)
                print("unfortuenetly you did not manage to complete the story i hope you enjoyed playing anyway")
                sys.exit()
        else:
            print(f"greetings stranger this town was attacked jut an hour ago save it and there would be a reward choose not to and fear my wreath")
            yn = input("save the town y/n").lower
            if choice == y:
                print("you choese well")
                fight
            else:
                print("that was a bad idea")
                time.sleep(0.2)
                print("the man pulls out a gun and puts it to your forhead...")
                time.sleep(0.3)
                print("you hear a bang...")
                time.sleep(0.1)
                print("and everything turns black")
                time.sleep(1)
                print("unfortuenetly you did not manage to complete the story i hope you enjoyed playing anyway")
                sys.exit()
        time.sleep(0.3)
    def fight():
        global slot1, slot2, slot3, ch, ammo
        print("you walk over to the fight.")
        for i in range(3):
            print(f"\nRound {i+1} begins!")
            attack()
            time.sleep(1)
            print("You won the battle! Your mission is complete. Restart the game to explore different scenarios or go take a trip to the mountins with your gear.")
            choice = input("reastart or go to the mountains")
            if choice == "mountains":
                print("you look around you to your left you can see an igloo far off into the distance to a few hundred yards to your right is a pair of skis and infront of you is miles of open snow")
                choice = input("would you like to \n A) go to the igloo\n B) pick up the skis or\n").lower()
                if "igloo" in choice:
                    explore_igloo()
                elif "ski" in choice:
                    skis()
                elif "explore" in choice:
                    time.sleep(1)
                    print("you walk on and on")
                    ch -= 3
                    print("you slide down the mountin and arrive at a lake")
                    time.sleep(1)
                    print("you climb around the cool shore of the lake to your left is a grand lush oak tree, to your right a line of stones protrudes into the lake and in the lake itself something shimmers from beneath the serfice")
                    choice = input("would you like to \n A) dive into the water\n B) explore from the edge\n").lower()
                    if "dive" in choice:
                        print("you plunge into the cool water")
                        time.sleep(0.5)
                        print("you try to serfice to catch your breath")
                        time.sleep(0.3)
                        print("but something is pulling you")
                        for i in range (10):
                            print("down")
                            time.sleep(0.1)
                            print("what was that pulling you into the depths reastart the story and look round the shore to find out")
                    elif "explore" in choice:
                        explore_lake()
            else:
                ("okay see you next time!")
                sys.exit()

    def attack():
        global slot1, slot2, slot3, ch, ammo
        print("a man swings his sword at you!")
        time.sleep(1)
        man_hp = 22
        while man_hp > 0:
            if slot1 =="2w08|)":
                choice = input(f"Choose your weapon: enchanted sword, {slot2} or {slot3}: ").lower()
            elif slot2 =="2w08|)":
                choice = input(f"Choose your weapon: {slot1}, enchanted sword or {slot3}: ").lower()
            elif slot2 =="2w08|)":
                choice = input(f"Choose your weapon: {slot1}, {slot2} or enchanted sword: ").lower()
            else:
                choice = input(f"Choose your weapon: {slot1}, {slot2} or {slot3}: ").lower()

            if choice == "gun" and slot1 == "gun" and ("ammo" in [slot2, slot3]) and ammo > 0:
                print("You fire your gun!")
                man_hp -= 6
                ammo -= 5
                print("The man retaliates during reload!")
                print(f"current ammo {ammo}")
                ouch = random.randint(2, 6)
                ch = ch - ouch
                print(ch)

            elif choice == "sword" and "2w08|)" in [slot1, slot2, slot3]:
                print("You swing the sea sword! A jet of water blasts the zombie.")
                man_hp = man_hp-5
                ouch = random.randint(0, 3)
                ch = ch - ouch
                print(ch)


            elif choice == "sword" and "sword" in [slot1, slot2, slot3]:
                print("You swing your sword!")
                man_hp = man_hp-2
                ouch = random.randint(0, 3)
                ch = ch - ouch
                print(ch)

            elif choice in [slot1, slot2, slot3]:
                print("You swing your item!")
                man_hp = man_hp-1
                ouch = random.randint(0, 3)
                ch = ch - ouch
                print(ch)

            else:
                print("You fumble with your gear. The man strikes!")
                ouch = random.randint(1, 3)
                ch = ch - ouch
                print(f"You take damage. Current health: {ch}")
                time.sleep(1)

            if ch <= 0:
                print("you died")

            print("You defeated the man!")
    def explore_lake():
        global slot1, slot2, slot3, ch, ammo
        print("you tread your way carefully around the lake")
        print("suddenly you hear a splash!")
        time.sleep(0.2)
        print("a tentacled creature jumps out the water!")
        print("you've heard of the creatures before they caled zectopus")
        time.sleep(1)
        water_hp = 22
        while water_hp > 0:
            if slot1 =="2w08|)":
                choice = input(f"Choose your weapon: enchanted sword, {slot2} or {slot3}: ").lower()
            elif slot2 =="2w08|)":
                choice = input(f"Choose your weapon: {slot1}, enchanted sword or {slot3}: ").lower()
            elif slot2 =="2w08|)":
                choice = input(f"Choose your weapon: {slot1}, {slot2} or enchanted sword: ").lower()
            else:
                choice = input(f"Choose your weapon: {slot1}, {slot2} or {slot3}: ").lower()

            if choice == "gun" and slot1 == "gun" and ("ammo" in [slot2, slot3]) and ammo > 0:
                print("You fire your gun!")
                water_hp -= 6
                ammo -= 5
                print("The zecopus retaliates during reload!")
                print(f"current ammo {ammo}")
                ouch = random.randint(2, 6)
                ch = ch - ouch
                print(ch)

            elif choice == "sword" and "2w08|)" in [slot1, slot2, slot3]:
                print("You swing the sea sword! A jet of water blasts the zectopus.")
                water_hp = water_hp-5
                ouch = random.randint(1, 3)
                ch = ch - ouch
                print(ch)


            elif choice == "sword" and "sword" in [slot1, slot2, slot3]:
                print("You swing your sword!")
                water_hp = water_hp-2
                ouch = random.randint(1, 3)
                ch = ch - ouch
                print(ch)

            elif choice in [slot1, slot2, slot3]:
                print("You swing your item!")
                water_hp = water_hp-1
                ouch = random.randint(1, 3)
                ch = ch - ouch
                print(ch)

            else:
                print("You fumble with your gear. The zectopus strikes!")
                ouch = random.randint(1, 3)
                ch = ch - ouch
                print(f"You take damage. Current health: {ch}")
                time.sleep(1)

            if ch <= 0:
                print("you died")

            print("You defeated the zectopus!")
            print("the air crackles with a strange energy the dead sectopus hovers in the air")
            print("you are into the cold water")
            time.sleep(0.3)
            print("and you begin to sink")
            for i in range (5):
                print("down,")
                time.sleep(0.1)
            boss()

    def skis():
        print("you walk over to the skis and put them on")
        time.sleep()
        print("turns out they were magic skis you feel stronger")
        mh = 35
        ch = 35
        choice = input(" you'v fineshed with the skis would you like to \n A) go to the igloo\n B) explore the snow or\n").lower()
        if "igloo" in choice:
            explore_igloo()
        elif "explore" in choice:
            time.sleep(1)
            print("you walk on and on")
            ch -= 3
            print("you slide down the mountin and arrive at a lake")
            time.sleep(1)
            print("you climb around the cool shore of the lake to your left is a grand lush oak tree, to your right a line of stones protrudes into the lake and in the lake itself something shimmers from beneath the serfice")
            choice = input("would you like to \n A) dive into the water\n B) explore from the edge\n").lower()
            if "dive" in choice:
                print("you plunge into the cool water")
                time.sleep(0.5)
                print("you try to serfice to catch your breath")
                time.sleep(0.3)
                print("but something is pulling you")
                for i in range (10):
                    print("down")
                    time.sleep(0.1)
                print("what was that pulling you into the depths reastart the story and look round the shore to find out")
            elif "explore" in choice:
                explore_lake()

    def boss():
        global slot1, slot2, slot3, ch, ammo
        os.system("final-battle.mp3")
        print("you open your eyes and find yourself in coleceum all around you water is somehow suspended allowing you to breath")
        time.sleep(0.5)
        print("you turn around to see a dragon staring you in the eyes")
        print("a man swings a breath of fire at you!")
        time.sleep(1)
        boss_hp = 50
        while boss_hp > 0:
            if slot1 =="2w08|)":
                choice = input(f"Choose your weapon: enchanted sword, {slot2} or {slot3}: ").lower()
            elif slot2 =="2w08|)":
                choice = input(f"Choose your weapon: {slot1}, enchanted sword or {slot3}: ").lower()
            elif slot2 =="2w08|)":
                choice = input(f"Choose your weapon: {slot1}, {slot2} or enchanted sword: ").lower()
            else:
                choice = input(f"Choose your weapon: {slot1}, {slot2} or {slot3}: ").lower()

            if choice == "gun" and slot1 == "gun" and ("ammo" in [slot2, slot3]) and ammo > 0:
                print("You fire your gun!")
                boss_hp -= 6
                ammo -= 5
                print("The dragon attacks while you are reloading!")
                print(f"current ammo {ammo}")
                ouch = random.randint(2, 6)
                ch = ch - ouch
                print(ch)

            elif choice == "sword" and "2w08|)" in [slot1, slot2, slot3]:
                print("You swing the sea sword! A jet of water blasts the dragon.")
                boss_hp = man_hp-5
                ouch = random.randint(0, 3)
                ch = ch - ouch
                print(ch)


            elif choice == "sword" and "sword" in [slot1, slot2, slot3]:
                print("You swing your sword!")
                boss_hp = man_hp-2
                ouch = random.randint(0, 3)
                ch = ch - ouch
                print(ch)

            elif choice in [slot1, slot2, slot3]:
                print("You swing your item!")
                boss_hp = man_hp-1
                ouch = random.randint(0, 3)
                ch = ch - ouch
                print(ch)

            else:
                print("You fumble with your gear. The dragon strikes!")
                ouch = random.randint(1, 3)
                ch = ch - ouch
                print(f"You take damage. Current health: {ch}")
                time.sleep(1)

            if ch <= 0:
                print("you died")

            print("You defeated the dragon!")
            print("you completed the game i hope you enjoyed it")
            sys.exit()

    def explore_igloo():
        global slot1, slot2, slot3, ch, ammo
        print("you walk into the igloo")
        time.sleep(0.3)
        print("suddenly a snowman appears and swings his sword at you!")
        time.sleep(1)
        man_hp = 22
        while man_hp > 0:
            if slot1 =="2w08|)":
                choice = input(f"Choose your weapon: enchanted sword, {slot2} or {slot3}: ").lower()
            elif slot2 =="2w08|)":
                choice = input(f"Choose your weapon: {slot1}, enchanted sword or {slot3}: ").lower()
            elif slot2 =="2w08|)":
                choice = input(f"Choose your weapon: {slot1}, {slot2} or enchanted sword: ").lower()
            else:
                choice = input(f"Choose your weapon: {slot1}, {slot2} or {slot3}: ").lower()

            if choice == "gun" and slot1 == "gun" and ("ammo" in [slot2, slot3]) and ammo > 0:
                print("You fire your gun!")
                man_hp -= 6
                ammo -= 5
                print("The snowman retaliates during reload!")
                print(f"current ammo {ammo}")
                ouch = random.randint(2, 6)
                ch = ch - ouch
                print(ch)

            elif choice == "sword" and "2w08|)" in [slot1, slot2, slot3]:
                print("You swing the sea sword! A jet of water blasts the zombie.")
                man_hp = man_hp-5
                ouch = random.randint(0, 3)
                ch = ch - ouch
                print(ch)


            elif choice == "sword" and "sword" in [slot1, slot2, slot3]:
                print("You swing your sword!")
                man_hp = man_hp-2
                ouch = random.randint(0, 3)
                ch = ch - ouch
                print(ch)

            elif choice in [slot1, slot2, slot3]:
                print("You swing your item!")
                man_hp = man_hp-1
                ouch = random.randint(0, 3)
                ch = ch - ouch
                print(ch)

            else:
                print("You fumble with your gear. The snowman strikes!")
                ouch = random.randint(1, 3)
                ch = ch - ouch
                print(f"You take damage. Current health: {ch}")
                time.sleep(1)

            if ch <= 0:
                print("you died")

            print("You defeated the snowman!")
            print("you walk out of the igloo")
            print("you start walking")
            time.sleep(1)
            print("you walk on and on")
            ch -= 3
            print("you slide down the mountin and arrive at a lake")
            time.sleep(1)
            print("you climb around the cool shore of the lake to your left is a grand lush oak tree, to your right a line of stones protrudes into the lake and in the lake itself something shimmers from beneath the serfice")
            choice = input("would you like to \n A) dive into the water\n B) explore from the edge\n").lower()
            if "dive" in choice:
                print("you plunge into the cool water")
                time.sleep(0.5)
                print("you try to serfice to catch your breath")
                time.sleep(0.3)
                print("but something is pulling you")
                for i in range (10):
                    print("down")
                    time.sleep(0.1)
                print("what was that pulling you into the depths reastart the story and look round the shore to find out")
            elif "explore" in choice:
                explore_lake()
        
        
    if pl == "beach":
        print("You look around. To your right are miles of sand dunes with tall grass swaying in the wind, to your left is a smashed-up ship, and in front are miles of open sea.")
        choice = input("Would you like to:\n A) explore the dunes\n B) look around the shipwreck\n C) swim around the shore\n").lower()
        if "dunes" in choice:
            explore_dunes()
        elif "ship" in choice:
            explore_shipwreck()
        elif "swim" in choice:
            swim_out_to_sea()
 
    elif pl == "town":
        print("you look around you to your left is the town hall and to your right there seems to be fome kind of fight")
        choice = input("would you like to \n A) go to the town hall or \n B) ask about the fight\n").lower()
        if "fight" in choice:
            fight()
        elif "hall" in choice:
            town_hall()
        
    elif pl == "mountain":
        print("you look around you to your left you can see an igloo far off into the distance to a few hundred yards to your right is a pair of skis and infront of you is miles of open snow")
        choice = input("would you like to \n A) go to the igloo\n B) pick up the skis or\n C) explore the snow\n").lower()
        if "igloo" in choice:
            explore_igloo()
        elif "ski" in choice:
            skis()
        elif "explore" in choice:
            time.sleep(1)
            print("you walk on and on")
            ch -= 3
            print("you slide down the mountin and arrive at a lake")
            time.sleep(1)
            print("you climb around the cool shore of the lake to your left is a grand lush oak tree, to your right a line of stones protrudes into the lake and in the lake itself something shimmers from beneath the serfice")
            choice = input("would you like to \n A) dive into the water\n B) explore from the edge\n").lower()
            if "dive" in choice:
                print("you plunge into the cool water")
                time.sleep(0.5)
                print("you try to serfice to catch your breath")
                time.sleep(0.3)
                print("but something is pulling you")
                for i in range (10):
                    print("down")
                    time.sleep(0.1)
                print("what was that pulling you into the depths reastart the story and look round the shore to find out")
            elif "explore" in choice:
                explore_lake()
        
    elif pl == "lake":
        print("you climb around the cool shore of the lake to your left is a grand lush oak tree, to your right a line of stones protrudes into the lake and in the lake itself something shimmers from beneath the serfice")
        choice = input("would you like to \n A) dive into the water\n B) explore from the edge\n").lower()
        if "dive" in choice:
            print("you plunge into the cool water")
            time.sleep(0.5)
            print("you try to serfice to catch your breath")
            time.sleep(0.3)
            print("but something is pulling you")
            for i in range (10):
                print("down")
                time.sleep(0.1)
            print("what was that pulling you into the depths reastart the story and look round the shore to find out")
        elif "explore" in choice:
            explore_lake()
        
    else:
        print("sorry this location is currently not available please check the map and find somewhere else")

#run the game and open the map
threading.Thread(target=continue_game, daemon=True).start()

window.mainloop()
